﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Model.Position>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Thêm mới
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%if (ViewData["MessageInfo"] == null) { %>
    <% using (Html.BeginForm("Create", "Position", FormMethod.Post, new { id = "adminForm" , name = "adminForm" })) {%>
    <%= Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Thêm mới</legend>
        <font color="red">*</font> là trường bắt buộc phải nhập.
        <table class="admintable">
        <tbody>
            <tr>
                <td class="key">Vị trí quảng cáo(<font color="red">*</font>)</td>
				<td>
					<%= Html.TextBoxFor(model => model.Name, new { @class = "required", maxlength = 20 })%>
				</td>
            </tr>
            <tr>
                <td class="key">Chia sẻ?</td>
				<td>
					<%=Html.CheckBox("chkShare",false) %>
				</td>
            </tr>                        
            <tr><td colspan="2" align="center"><input type="submit" value="Lưu" /></td></tr>
        </tbody>
        </table>
    </fieldset>
    <% } %>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#adminForm").validate({
                rules: {
                    Name: "required"
                },
                messages: {
                    Name: "Trường này là bắt buộc, vui lòng nhập dữ liệu!"
                }
            });
        });
    </script>

    <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Vị trí quảng cáo
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%> 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Về danh sách", "/Position", "back") %>
</asp:Content>
